package cvsexercise8;

/* Create the Shape class declaration according to the UML for Shape
 * include an instance variables to store the colour (String)
 * include a constructor (that takes a String parameter to set the colour)
 * include a setter method (that takes a String parameter to change the colour)
 * include a getter method (to return the current colour String)
 * include a public method to display a message and return 0 for the area
 * include an overridden toString() method to output the current colour
 */
public class Shape {

	/* private string instance variable */
	private String strColour;
	
	/* constructor (takes a string parameter) */
	public Shape(String colour) {
		this.strColour = colour;
	}
	
	/* setter method to change the colour of the shape */
	public void setColour(String colour) {
		this.strColour = colour;
	}
	
	/* getter method to return the colour (as a String) */
	public String getColour() {
		return strColour;
	}
	
	/* getArea() method to return 0 (double) and write a message to error output */
	public double getArea() {
		System.err.println("Shape has no area!!!");
		return 0.0;
	}
	
	/* override the toString() method to write out the current colour */
	@Override
	public String toString() {
		return ("Shape has colour = " + strColour);
	}
}
